﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;

namespace Peak.Web.Controllers.Models
{
  public class SprintModelValidator : AbstractValidator<SprintModel>
  {
    public SprintModelValidator()
    {
      RuleFor(f => f.Name).NotNull().NotEmpty();
      RuleFor(f => f.Start)
        .GreaterThan(DateTime.MinValue)
        .LessThan(DateTime.MaxValue);
      RuleFor(f => f.End)
        .GreaterThan(DateTime.MinValue)
        .LessThan(DateTime.MaxValue)
        .GreaterThanOrEqualTo(f=>f.Start);
    }
  }
}
